home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / iconv8_l.arc / IDOL.ARC / OS2.ICN < prev    next >
Encoding:
Text File  |  1990-03-19  |  2.0 KB  |  81 lines

  1. #
  2. # @(#)os2.icn    1.3 3/13/90
  3. # OS-specific code for OS/2 Idol
  4. # Adapted from msdos.icn by cheyenne wills
  5. #
  6. global lnkopt,cd,md,env,sysok
  7.  
  8. procedure mysystem(s)
  9.   if \loud then write(s)
  10.   return system(s)
  11. end
  12.  
  13. procedure filename(s)
  14.   s[9:0] := ""
  15.   return s
  16. end
  17. procedure writesublink(s)
  18.   writelink(env||"\\\\"||s)
  19. end
  20. procedure envpath(filename)
  21.   return env||"\\"||filename
  22. end
  23. #
  24. # Installation.
  25. # Uses hierarchical filesystem on some systems (see initialize)
  26. #
  27. procedure install(args)
  28.   write("Installing idol environment in ",env)
  29.   if env ~== "" then mysystem(md||env)
  30.   fout := envopen("i_object.icn","w")
  31.   write(fout,"record idol_object(__state,__methods)")
  32.   close(fout)
  33.   fout := &null
  34.   cdicont(["i_object"])
  35. end
  36.  
  37. procedure makeexe(args,i)
  38.   exe := args[i]
  39.   if icont(lnkopt||exe) = \sysok then {
  40.       mysystem((if find("UNIX",&features) then "rm " else "del ")||exe||".icn")
  41.       if \exec then {
  42.     write("Executing:")
  43.     if not find("UNIX",&features) then exe := "iconx "||exe
  44.     every i := exec+1 to *args do exe ||:= " "||args[i]
  45.     mysystem(exe)
  46.       }
  47.   }
  48. end
  49. #
  50. # system-dependent compilation of idolfile.icn
  51. #   (in the idol subdirectory, if there is one)
  52. #
  53. procedure cdicont(idolfiles)
  54. initial { s := (getenv("ICONT")|"icont") }
  55.  
  56.   if comp = -2 then return  # -t --> don't call icont at all
  57.   args := " -c"
  58.   rms  := ""
  59.   every ifile := !idolfiles do args ||:= " " || ifile
  60.   every ifile := !idolfiles do rms  ||:= " " || ifile || ".icn"
  61.   cdcmd := open("idolenv.cmd","w")
  62.   write(cdcmd,"@echo off")
  63.   write(cdcmd,"cd idolcode.env")
  64.   write(cdcmd,s,args)
  65.   write(cdcmd,"if errorlevel 1 goto xit")
  66.   every ifile := !idolfiles do
  67.     write(cdcmd,"del ",ifile,".icn")
  68.   write(cdcmd,":xit")
  69.   write(cdcmd,"cd ..")
  70.   close(cdcmd)
  71.   mysystem("idolenv.cmd")
  72.   mysystem("del idolenv.cmd")
  73. end
  74. procedure sysinitialize()
  75.   lnkopt := " -Sr500 -SF30 -Si1000 "
  76.   cd := "cd "
  77.   md := "mkdir "
  78.   env := "idolcode.env"
  79.   sysok := 0
  80. end
  81.